﻿<%@ Page Title="Редагувати сферу  діяльності" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="Work.UI.Web.Forms.Admin.Section.Edit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="contentHeader" runat="server">
Редагувати сферу  діяльності
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:ObjectDataSource ID="odsSection" runat="server"
        TypeName="Work.BL.Hibernate.Managers.HSectionManager"
        DataObjectTypeName="Work.BL.POCOs.SectionPOCO"
        SelectMethod="GetSectionById"
        UpdateMethod="Edit"
        onobjectcreating="odsSectionObjectCreating">

            <SelectParameters>
                <asp:QueryStringParameter Name="sectionId" QueryStringField="Id" Type="Int32" />
            </SelectParameters>

        </asp:ObjectDataSource>

    <asp:FormView ID="frvSection"  runat="server"
        
        DataSourceID="odsSection"
        DataKeyNames="Id" DefaultMode="Edit" 
        OnItemUpdated="frvSection_ItemUpdate" >

        <EditItemTemplate>

            <table class="addEdit">

                <tr>
                    <td>Name: </td>
                    <td>
                        <asp:TextBox ID="tbName" Text='<%# Bind("Name") %>' runat="server"/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ErrorMessage="Required field"
                                ValidationGroup="region"
                                ControlToValidate="tbName" 
                                Display="Dynamic"/>
                        <asp:RegularExpressionValidator ID="revSmallName" runat="server" 
                                ErrorMessage="Length should not exceed 50"                                                                                                             
                                ControlToValidate="tbName"
                                ValidationGroup="region" 
                                ValidationExpression=".{1,50}"
                                Display="Dynamic" />
                    </td>
                </tr>

                

            </table>

            <asp:LinkButton ID="AddUser" runat="server" ValidationGroup="region"
                onclick="AddSection_Click"  CausesValidation="true" CssClass="button1">
                    <strong>Edit</strong>
            </asp:LinkButton>
            <asp:LinkButton ID="LinkButton1" runat="server" Text="Edit" ValidationGroup="region"
                onclick="Cansel_Click" CausesValidation="true" CssClass="button1">
                    <strong>Cansel</strong>
                </asp:LinkButton>
                
            </EditItemTemplate>

        </asp:FormView>

</asp:Content>
